<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <title>个人信息</title>
</head>

<style>
    /*panel图片*/
    .back-panel{
        /*background-image: url("https://img.ivsky.com/img/tupian/pre/202002/25/maitian-005.jpg");*/
        background-size: 100% 50%;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }

    .text-border-radius{
        border-radius: 50px 50px 50px 50px !important;
    }

    .button-width{
        width: 130px;
    }
    /*border*/
    .border-no{
        border: none;
    }

    .text-shadow{
        text-shadow: 0px 0px 3px black;
    }
</style>

<body>

<!--导航-->
<nav th:fragment="menu(n)" class="navbar navbar-inverse lucency-sm rounded-no lucency-sm animated fadeIn">
    <div class="container">

        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">切换</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#" th:href="@{/}" ><b>创美网盘</b></a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" style="overflow: visible !important;">
            <ul class="nav navbar-nav">

                <li><a th:href="@{/}" href="#"><span class="glyphicon glyphicon-home"></span> 首页</a></li>
                <li><a href="#" th:href="|@{/goDisk}?pagestart=1|"><sapn class="glyphicon glyphicon-tag"></sapn> 网盘</a></li>
                <li><a href="#" th:href="@{/dynamic/index}"><sapn class="glyphicon glyphicon-align-left"></sapn> 动态</a></li>
                <li><a href="#" th:href="@{/aboutus}"><span class="glyphicon glyphicon-list"></span> 关于我们</a></li>
                <li class="active"><a href="#"><span class="glyphicon glyphicon-bookmark"></span> 用户信息</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <!--<li><img id="avatar" src="http://www.blogry.cn/images/avatar.jpg" class="img-circle" width="40px" height="40px"></li>-->
                <li th:if="${user} == null"><a href="#" th:href="@{/loginIndex}"><sapn class="glyphicon glyphicon-user"></sapn> 登录</a></li>
                <!--<li><a href="#" th:href="@{/goDisk}"><sapn class="glyphicon glyphicon-bookmark"> 我的网盘</span></a></li>-->
                <li class="dropdown">
                    <a href="javascript:(0)" data-toggle="dropdown">
                        <img class="img-size-least img-circle" src="../sWtatic/images/avatar/avatar.jpg" th:src="${user.getAvatar()}">
                        <span th:text="${user.getNickname()}">hello</span>
                    </a>
                    <ul class="dropdown-menu" role="menu">
                        <li role="presentation" class="dropdown-header">登录操作</li>
                        <li><a href="#" th:href="@{/user/logout}"  role="menuitem"><span class="glyphicon glyphicon-remove"></span> 注销</a></li>
                        <!--分割线-->
                        <li class="divider"></li>
                        <li role="presentation" class="dropdown-header">用户操作</li>
                        <li><a href="#" th:href="@{/user/editor}" role="menuitem"><span class="glyphicon glyphicon-pencil"></span> 编辑信息</a></li>
                    </ul>
                </li>
                <!--<li class=""><a href="#"><span class="glyphicon glyphicon-pencil"></span> 修改</a></li>-->
            </ul>
        </div>
    </div>
</nav>

<br>
<br>
<br>
<br>
<br>
<br>
<div class="container animated zoomIn">

    <div class="col-md-12">
        <div class="panel panel-success border-no lucency-xs" >
            <div class="panel-heading back-panel" id="panelhead">
                <img src="/images/avatar/avatar.jpg" th:src="${user.getAvatar()}" class="img-size-xs img-circle">
                <h1 class="text-color-white text-shadow" th:text="${user.getUsername()}">Renyi</h1>
                <a href="#" th:href="@{/user/editorPassword}" class="btn btn-info">更改密码</a>
            </div>
            <div class="row">
                <div class="panel-body">
                    <div class="col-md-8 col-md-offset-2">
                        <h3 class="">编辑个人信息</h3>
                        <hr>
                        <form action="#" th:action="@{/user/editorinfo}" role="form">


                            <div class="input-group">
                                <label>昵称</label>
                                <input th:value="${user.getNickname()}" type="text" name="nickname" class="form-control text-border-radius" placeholder="昵称...">
                            </div>
                            <br>
                            <div class="input-group">
                                <label>邮箱</label>
                                <input th:value="${user.getEmail()}" type="email" name="email" class="form-control text-border-radius" placeholder="邮箱...">
                            </div>
                            <br>
                            <div class="input-group">
                                <label>头像</label>
                                <input th:value="${user.getAvatar()}" type="text" name="avatar" class="form-control text-border-radius" placeholder="头像地址...">
                            </div>
                            <br>
                            <div class="input-group">
                                <label>首图</label>
                                <input th:value="${user.getFirstPicture()}" type="text" name="firstPicture" class="form-control text-border-radius" placeholder="首图地址...">
                            </div>
                            <br>
                            <div class="input-group">
                                <label>介绍</label><br>
                                <textarea th:text="${user.getIntroduction()}"  name="introduction" placeholder="个人介绍..." cols="50" rows="5"></textarea>
                            </div>
                            <br>
                            <input type="submit" value="提交" class="btn btn-success button-width">
                            <input type="reset" value="重置" class="btn btn-info button-width">
                        </form>
                    </div>
                </div>
            </div>

        </div>
    </div>

</div>


<!--/*/<th:block th:replace="fragments :: script">/*/-->
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<!--加载bootstrap验证器-->
<script src="../static/bootstrap/js/bootstrapValidator.min.js" th:src="@{/bootstrap/js/bootstrapValidator.min.js}"></script>
<!--/*/</th:block>/*/-->

<script th:inline="javascript" type="text/javascript">
    var url = [[${user.firstPicture}]];
    //alert(url);
    //设置首图
    document.getElementById("panelhead").style.backgroundImage="url(" + url + ")";
</script>
</body>
</html>